Optimal. Leaf size=51 \[ \frac{a^2 \log (\tan (e+f x))}{f}+\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{b^2 \tan ^2(e+f x)}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0635241, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3670, 446, 72} \[ \frac{a^2 \log (\tan (e+f x))}{f}+\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{b^2 \tan ^2(e+f x)}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3670
Rule 446
Rule 72
Rubi steps
\begin{align*} \int \cot (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{x \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{(a+b x)^2}{x (1+x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b^2+\frac{a^2}{x}-\frac{(a-b)^2}{1+x}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{a^2 \log (\tan (e+f x))}{f}+\frac{b^2 \tan ^2(e+f x)}{2 f}\\ \end{align*}
Mathematica [A] time = 0.120248, size = 65, normalized size = 1.27 \[ \frac{a^2 (\log (\tan (e+f x))+\log (\cos (e+f x)))}{f}-\frac{2 a b \log (\cos (e+f x))}{f}+\frac{b^2 \left (\tan ^2(e+f x)+2 \log (\cos (e+f x))\right )}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.052, size = 60, normalized size = 1.2 \begin{align*}{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,f}}+{\frac{{b}^{2}\ln \left ( \cos \left ( fx+e \right ) \right ) }{f}}-2\,{\frac{ab\ln \left ( \cos \left ( fx+e \right ) \right ) }{f}}+{\frac{{a}^{2}\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.08708, size = 80, normalized size = 1.57 \begin{align*} \frac{a^{2} \log \left (\sin \left (f x + e\right )^{2}\right ) -{\left (2 \, a b - b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac{b^{2}}{\sin \left (f x + e\right )^{2} - 1}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.16974, size = 161, normalized size = 3.16 \begin{align*} \frac{b^{2} \tan \left (f x + e\right )^{2} + a^{2} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) -{\left (2 \, a b - b^{2}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.48656, size = 97, normalized size = 1.9 \begin{align*} \begin{cases} - \frac{a^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a^{2} \log{\left (\tan{\left (e + f x \right )} \right )}}{f} + \frac{a b \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} - \frac{b^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{b^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \cot{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.57969, size = 124, normalized size = 2.43 \begin{align*} \frac{a^{2} \log \left (\sin \left (f x + e\right )^{2}\right ) -{\left (2 \, a b - b^{2}\right )} \log \left (-\sin \left (f x + e\right )^{2} + 1\right ) + \frac{2 \, a b \sin \left (f x + e\right )^{2} - b^{2} \sin \left (f x + e\right )^{2} - 2 \, a b}{\sin \left (f x + e\right )^{2} - 1}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]